﻿//--------------------- Copyright Block ----------------------
/*


C# Code By: Tareq Ateik

License: GNU General Public License, ver 3

TERMS OF USE:
	Permission is granted to use this code, with or
	without modification, in any website or application
	provided that credit is given to the original work
	with a link back to ateik.me

This program is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY.

PLEASE DO NOT REMOVE THIS COPYRIGHT BLOCK.

*/

using System.Runtime.Serialization;
using System.Device.Location;
using System;

namespace PrayerTime
{
    public enum CalcuationMethod { MWL, ISNA, Egypt, Makkah, Karachi, Tehran, Jafari }
    public enum AsrMethod { Shafii, Hanafi }
    [DataContract]
    public class PrayerSettings
    {
        [DataMember]
        public GeoCoordinate CurrentLocation { get; set; }
        [DataMember]
        public string CurrentCity { get; set; }
        [DataMember]
        public CalcuationMethod CalculationMethod { get; set; }
        [DataMember]
        public bool UseGPS { get; set; }
        [DataMember]
        public AsrMethod AsrMethod { get; set; }
    }
    public class ReverseGeocodingResults
    {
        public string Type { get; set; }
        public string City { get; set; }
        public string Dummy { get; set; }
    }
    public class Prayer
    {
        public string PrayerTime { get; set; }
        public string PrayerTitle { get; set; }
        public string PrayerAfterText
        {
            get
            {
                if (DateTime.Parse(PrayerTime) > DateTime.Now)
                {
                    int hours = DateTime.Parse(PrayerTime).Subtract(DateTime.Now).Hours;
                    int minutes = DateTime.Parse(PrayerTime).Subtract(DateTime.Now).Minutes;
                    return "after " + hours + ((hours > 1) ? " Hours, " : " Hour, ") + minutes + ((minutes > 1) ? " Minutes" : " Minute");
                }
                return "";
            }
        }
    }
    public class ResearchResult
    {
        public GeoCoordinate Location { get; set; }
        public string City { get; set; }
    }
    public class Mosque
    {
        public string Name { get; set; }
        public string Vicinity { get; set; }
        public GeoCoordinate Location { get; set; }
    }
}